package com.example.androidcomplete02.fragment;

import android.app.Activity;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.example.androidcomplete02.R;

public class RadioAndCheck extends Activity implements
RadioDialogFragment.NoticeDialogListener, CheckDialogFragment.NoticeDialogListener  {
	TextView tv;

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch20_radioandcheckbox);
		tv = (TextView) findViewById(R.id.tvradioandcheck);
	}

	public void mOnClick(View v) {
		switch (v.getId()) {
		case R.id.btnradio:
			DialogFragment newFragment = new RadioDialogFragment();
			newFragment.show(getFragmentManager(), "Dialog");
			break;
		case R.id.btncheckbox:
			DialogFragment newFragment2 = new CheckDialogFragment();
			newFragment2.show(getFragmentManager(), "Dialog");
			break;
		}

	}

	public void onDialogClick(DialogFragment dialog, String res) {
		tv.setText("선택한 음식 = " + res);
	}
}